﻿#-*- coding: utf-8 -*-

_tables = (
	('t_user', '''create table t_user (
		id serial,
		username varchar(31) character set utf8,
		namealias varchar(31) character set utf8,
		fullname varchar(31) character set utf8,
		email varchar(63) character set utf8,
		domainname varchar(31) character set utf8,
		passhash varchar(63) character set utf8,
		createdate bigint,
		lastlogindate bigint,
		theme varchar(31) character set utf8,
		status tinyint,
		isroot tinyint
	)'''), 
	('t_category','''create table t_category (
		id serial,
		categoryname varchar(31) character set utf8,
		userid  bigint,
		listindex int,
		postcount int
	)'''),
	('t_post', '''create table t_post (
		id serial,
		subject varchar(127) character set utf8,
		subjecturl varchar(127) character set utf8,
		frontphoto varchar(63) character set utf8,
		content mediumtext character set utf8,
		createdate bigint,
		status tinyint,
		userid bigint,
		categoryid bigint,
		commentcount int,
		lastmodified bigint,
		allowcomment tinyint,
		highlight tinyint,
		visualstyle tinyint,
		upvote int,
		downvote int
	)'''),
	('t_mediafile', '''create table t_mediafile (
		id serial,
		filename varchar(63) character set utf8,
		filesize int,
		createdate bigint,
		userid bigint,
		postid bigint
	)'''),
	('t_comment', '''create table t_comment (
		id serial,
		postid bigint,
		userid bigint,
		parentid bigint,
		author varchar(31) character set utf8,
		email varchar(63) character set utf8,
		sourceurl varchar(63) character set utf8,
		clientip varchar(15) character set utf8,
		content text character set utf8,
		createdate bigint,
		status tinyint,
		upvote int,
		downvote int
	)'''),
	('t_link', '''create table t_link (
		id serial,
		userid bigint,
		listindex int,
		label varchar(31) character set utf8,
		url varchar(63) character set utf8,
		highlight tinyint,
		linkdesc varchar(127) character set utf8,
		position int
	)''')
)


